<!DOCTYPE html>
<html lang="en">
<script src="plugins/healthmobile.js"></script>
<title>密码找回</title>
<meta charset="utf-8">
<link href="https://assets.gitee.com/assets/application-63a1570869c4520636e799637ee47b62.css" media="screen"
      rel="stylesheet">
<script type="text/x-mathjax-config;executed=true">
</script>
<script src="https://assets.gitee.com/uploads/resources/MathJax-2.7.2/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<!-- 引入样式 -->
<link rel="stylesheet" href="plugins/elementui/index.css">
<link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="css/style.css">
<!-- 引入组件库 -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="js/vue.js"></script>
<script src="plugins/elementui/index.js"></script>
<script src="js/axios-0.18.0.js"></script>
<script src="plugins/healthmobile.js"></script>
</header>
<body>
<div class="site-content" id="app">
    <div class="fixed-notice-infos">
        <div class="all-messages">
        </div>
        <div class="ui container">
            <div class="flash-messages" id="messages-container"></div>
        </div>
    </div>
    <div class="self-services">
        <div class="ui container">
            <div class="self-services__header">
                <h1 class="ui header">密码找回</h1>
                <div class="subtitle">请输入新密码</div>
            </div>
            <div class="self-services__body">
                <div class="self-services__form" id="password-form">
                    <div class="field">
                        <div class="ui message error self-services__error hide"></div>
                    </div>
                    <div class="field">
                        <div class="ui left icon input">
                            <i class="icon envelope outline"></i>
                            <input id="self-services__name" name="name" v-model="formData" placeholder="新密码"
                                   type="text" value="">
                        </div>
                    </div>
                    <div class="field">
                        <div class="self-services__btnsubmit">
                            <a class="ui button large fluid orange" href="javascript: void(0);" @click="reset">重置密码</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    var checkName = getUrlParam("checkName")
    var vue = new Vue({
        el:'#app',
        data:{
            formData:''
        },
        methods:{
            reset (){
                var params = new URLSearchParams()
                params.append("checkName",checkName)
                params.append("password",this.formData)
                axios.post("/user/updatePassword.do",params).then((res)=>{
                    if (res.data.flag){
                        window.location.href='skip.html'
                    } else {
                        this.$message.error(res.data.message)
                    }
                })
            }
        }
    })
</script>
</html>